import {aspect, BusinessError} from '@codefree/badger/service'
import {HTTP_STATUS_CODE, RESPONSE_CODE} from '../utility/enums'

export default aspect.beforeMethodOnClass({
    handle: (metadata) => {
        if (!metadata.args[0].user) {
            throw new BusinessError('unauthorized', null, HTTP_STATUS_CODE.UNAUTHORIZED)
        }
    }
});